﻿
#Region "Using Directives"

Imports System

#End Region

Namespace C4F.DevKit.Bluetooth.ObjectPushProfile


#Region "ObjectPushCompletedEventArgs"

    ''' <summary>
    ''' EventArgs class to be used when an Object Push operation completes.
    ''' </summary>
    Public Class ObjectPushCompletedEventArgs
        Inherits ComponentModel.AsyncCompletedEventArgs

#Region "Private Fields"

        ''' <summary>
        ''' The name of the object that was pushed to the remote device.
        ''' </summary>
        Private m_localObjectName As String

#End Region

#Region "Public Properties"

        ''' <summary>
        ''' Gets the name of the object that was pushed to the remote device.
        ''' </summary>
        Public ReadOnly Property LocalObjectName() As String

            Get
                Return Me.m_localObjectName
            End Get

        End Property

#End Region

#Region "Constructors"

        ''' <summary>
        ''' Initializes the ObjectPushCompletedEventArgs object.
        ''' </summary>
        ''' <param name="localObjectName">The name of the object that was 
        ''' pushed to the remote device.</param>
        ''' <param name="error">An error that occurred during the asynchronous
        ''' operation.</param>
        ''' <param name="cancelled">A value indicating whether the asynchronous
        ''' operation was cancelled.</param>
        ''' <param name="userState">The user-supplied state object supplied 
        ''' when the asynchronous operation was requested.</param>
        ''' <exception cref="ArgumentNullException">LocalObjectName is passed
        ''' as an empty string or a null reference.</exception>
        Public Sub New(ByVal localObjectName As String, ByVal [error] As Exception, ByVal cancelled As Boolean, _
                        ByVal userState As Object)

            MyBase.New([error], cancelled, userState)

            If String.IsNullOrEmpty(localObjectName) Then
                Throw New ArgumentNullException("localObjectName")
            End If

            Me.m_localObjectName = localObjectName

        End Sub

#End Region

    End Class

#End Region

End Namespace